import {
  AIResponse,
  ContentPayload,
  HandlePolicy, InferredResult,
  PostHandlerResponse,
  PreHandlerResponse
} from '../sdk/RequestHandleSDK';

/**
 * Preprocessing Result Utility Class
 */
export class ResultUtil {


  /**
   * Build Preprocessing Result
   * 
   * @param policy 
   * @param payload 
   * @param reason
   */
  static buildPreHandlerResponse(policy: HandlePolicy, payload: ContentPayload, reason: string): PreHandlerResponse {
    return {
      handlePolicy: policy,
      reason: reason,
      payload: payload,
    };
  }

  /**
   * Post-build Processing Result
   * @param policy
   * @param processedResult
   * @param reason
   */
  static buildPostHandlerResponse(policy: HandlePolicy, processedResult: InferredResult, reason: string): PostHandlerResponse {
    return {
      handlePolicy: policy,
      reason: reason,
      processedResult: processedResult,
    };
  }
}
